from typing import List
import random

def generation(length:int)->List: 
    result = []
    for i in range(length-1):
        result.append(random.randint(1,99))
        k = random.randint(1,4)
        #print(k)
        if k == 1:
            result.append("+")
        elif k == 2:
            result.append("-")
        elif k == 3:
            result.append("x")
        else: #k=4
            result.append("÷")
    result.append(random.randint(1,99))
    return result

def generation2(length:int)->List: #生成整除式子,且不会同时出现2个连在一起的/
    flag = 0
    x = 0
    result = []
    for i in range(length):
        if flag == 1:
            flag = 0 #flag复位否则就会出现bug
            result.append(x)
            if i == length-1:
                return result
            k = random.randint(1,3)
            print(k)
            if k == 1:
                result.append("+")
            elif k == 2:
                result.append("-")
            else:
                result.append("x")
        else:
            if i == length-1:
                result.append(random.randint(1,99))
                return result
            k = random.randint(1,4)
            print(k)
            if k == 1:
                result.append(random.randint(1,99))
                result.append("+")
            elif k == 2:
                result.append(random.randint(1,99))
                result.append("-")
            elif k == 3:
                result.append(random.randint(1,99))
                result.append("x")
            else:
                flag = 1
                x = random.randint(1,99)
                n = random.randint(2,9)
                result.append(n*x)
                result.append("÷")
                
            
            
    
k = input("input an integer:(done to end)")
while not k == "done":
    k = int(k)
    print(generation2(k))
    k = input("input an integer:(done to end)")
